package com.sz.designpattern.behavior11.mediator;

public class Lianjia implements HouseMediator{
    Purchaser purchaser;
    Landlord landlord;

    public void setPurchaser(Purchaser purchaser) {
        this.purchaser = purchaser;
    }

    public void setLandlord(Landlord landlord) {
        this.landlord = landlord;
    }

    @Override
    public void notice(Person person, String msg) {
        System.out.println("mediator .notice");
        if (person == purchaser){
            landlord.getNotice(msg);
        }else if (person == landlord){
            purchaser.getNotice(msg);
        }
    }
}
